// 需求：给li标签添加提示框，鼠标悬浮时li标签展示出提示框，鼠标移走消失
var liObj = document.querySelectorAll('li')
liObj.forEach(function(item,i){
    var tips = document.querySelector('div')
    item.onmousemove = function(evt){
        var e = evt || window.event
        // tips.innerText = this.innerText
        tips.style.display = 'block'
        tips.style.top = e.clientY - 28 + 'px'  //此处加了绝对定位，因此加offset会以网页为参照
        tips.style.left = e.clientX -63 + 'px'
    }
    item.onmouseout = function(){
        tips.style.display = 'none'
    }
})